package com.zealfi.example.test.rabbitmq.controller;

import com.zealfi.example.test.rabbitmq.amqp.producer.LoanApplyMQProducer;
import com.zealfi.example.test.rabbitmq.pojo.MemberPojo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @功能:【RabbitmqTestController 测试rabbitmq方法】
 * @作者:代守诚
 * @日期:2018/10/23
 * @时间:11:38
 */
@RestController
@RequestMapping("/rabbit")
public class RabbitmqTestController {
    @Autowired
    private LoanApplyMQProducer loanApplyMQProducer;

    @RequestMapping(value = "/test", method = {RequestMethod.POST, RequestMethod.GET})
    public void rabbitmqTest() {
        System.err.println("**********发送方法准备就绪***********");
        boolean flag = loanApplyMQProducer.send(new MemberPojo());
        System.err.println("*********发送成功***********" + flag);
    }
}
